package stars;

import java.util.HashSet;

import model.IModel;

import com.jme3.input.controls.ActionListener;
import com.jme3.material.Material;
import com.jme3.math.ColorRGBA;
import com.jme3.math.Vector2f;
import com.jme3.math.Vector3f;
import com.jme3.scene.Geometry;
import com.jme3.scene.shape.Box;
import com.jme3.texture.Texture;

import controller.IController;
import eventManager.IEventData;

import view.EViewList;
import view.AbstractView;
import view.IView;

public class StarView extends AbstractView {

	private Material material;
	private Geometry geometry;
	
	private HashSet<String> inputListeners = new HashSet<String>();
	
	public StarView(EViewList name, Material material)
	{
		super(name);
		//this.view = new View(name);
		this.material = material;
		loadInputListeners();
	}

	//IConcreteView methods
	public void onAction(String arg0, boolean arg1, float arg2) {
		// TODO Auto-generated method stub
		
	}

	public void initView() {
		String identifier = String.valueOf(this.model.getKeyValue());
		geometry = new Geometry(identifier, new Box(Vector3f.ZERO, 1.0f,1.0f,1.0f));
		geometry.setMaterial(material);		
		update();
	}

	public void closeView() {
		this.geometry = null;
	}

	public Geometry getGeometry() {
		return this.geometry;
	}

	public void loadInputListeners() {
		
	}

	public HashSet<String> getInputListeners() {
		return this.inputListeners;
	}
	
	public void update() {
		
	}

//	public void executeStrategy(IEventData event) {
//		view.executeStrategy(event);
//	}
//
//	public void setController(IController controller) {
//		view.setController(controller);
//	}
//
//	public void setModel(IModel model) {
//		view.setModel(model);
//	}
//
//	public EViewList getName() {
//		return view.getName();
//	}
//
//	public IModel getModel() {
//		return view.getModel();
//	}
	
	
	
	
	
//	public void initView() {
//		String identifier = String.valueOf(modelKey.getValue());
//		geometry = new Geometry(identifier, new Box(Vector3f.ZERO, 1.0f,1.0f,1.0f));
//		geometry.setMaterial(material);		
//		update();
//	}
//	
//	public void update() {
//		StarModel fullModel = (StarModel) model;		
//		
//		//update location
//		Vector2f trans = fullModel.getLocation();
//		Vector3f tempTrans = new Vector3f(trans.x, trans.y, 0.0f);
//		
//		geometry.setLocalTranslation(tempTrans);
//	}
//	
//	public void onAction(String arg0, boolean arg1, float arg2) {
//		// TODO Auto-generated method stub
//		
//	}
//
//	@Override
//	protected void loadInputListeners() {
//		// TODO Auto-generated method stub
//		
//	}		
}
